package com.zx.framework.core.util;

import com.zx.framework.core.pagination.Pagination;

public class ClientMap extends ChainMap<String, Object> {
	
	public ClientMap message(String message){
		return (ClientMap) put("message", message);
	}

	public ClientMap success(boolean success){
		return (ClientMap) put("success", success); 
	}
	
	public ClientMap success(){
		return (ClientMap) put("success", true); 
	}
	
	public ClientMap failure(){
		return (ClientMap) put("success", false); 
	}
	
	public ClientMap code(String code){
		return (ClientMap) put("code", code);
	}
	
	public ClientMap code(int code){
		return (ClientMap) put("code", code);
	}
	
	public ClientMap datas(Object datas){
		return (ClientMap) put("datas", datas);
	}
	
	public ClientMap tabId(String moduleId){
		return (ClientMap) put("tabid", moduleId);
	}
	
	public ClientMap dialogId(String moduleId){
		return (ClientMap) put("dialogid", moduleId);
	}
	
	public ClientMap closeCurrent(){
		return (ClientMap) put("closeCurrent", true);
	}
	/**
	 * 用于服务端设置ui格式的json
	 * @param uiJson
	 * @return
	 */
	public ClientMap uiJson(String uiJson){
		return (ClientMap) put("ui", uiJson);
	}
	/**
	 * 用于设置ui端显示控制按钮等组件的json
	 * @param operateJson
	 * @return
	 */
	public ClientMap operateJson(String operateJson){
		return (ClientMap) put("operate", operateJson);
	}
	
	public ClientMap rows(int rows){
		return (ClientMap) put("rows", rows);
	}
	
	public ClientMap pagination(Pagination pagination){
		return (ClientMap) put("pagination", pagination);
	}
}
